package com.redpig.controller.system;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.redpig.entity.Menu;
import com.redpig.service.IMenuService;
import com.redpig.util.JwtUtils;
import com.redpig.util.Result;
import com.redpig.util.RouteTools;
import com.redpig.vo.RouteVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Api(tags = "路由")
@RestController
public class RouteController {

    @Autowired
    IMenuService menuService;

    @Autowired
    RouteTools routeTools;

    @ApiOperation(value = "构建路由")
    @GetMapping("/route/getRoutes")
    public Result getRoutes(){
        return Result.ok(routeTools.buildRouteTree());
    }
}
